Commonly used JPEG baseline encoding and decoding methods of the prior art all consist of the steps of splitting an image into minimum coded units (MCU's) and sequentially performing DCT, quantization and entropy coding processes on the MCU's, in the order where the MCU's are raster scanned.
FIG. 1 is a flow diagram illustrating the principal steps of a compression algorithm executed by a standard JPEG encoder, including:
a) division of an image into blocks of 8×8 pixels;
b) forward discrete cosine transformation (FDCT);
c) quantization;
d) zigzag scanning; and
e) entropy coding, accomplished by subjecting DC coefficients to differential pulse-code modulation (DPCM) and AC coefficients to run-length coding (RLC).
Due to the occurrence of data correlation of JPEG bitstream, for example, in the DPCM of DC coefficients, decoding of a JPEG file generated by this algorithm must be done from the beginning of the compression data even when the JPEG file has a large size and the region of interest (ROI) only accounts for a small part of the image. That is, the algorithm does not allow decoding at a random access point. This disadvantageously necessitates a display cache large enough to store the whole JPEG file to ensure a sufficient display speed.
FIG. 2 depicts a flowchart illustrating the principal steps of a decompression algorithm executed by the standard JPEG encoder, including:
1) entropy decoding, including run-length decoding (RLD) for recovering AC components and inverse DPCM for recovering DC components;
2) inverse quantization;
3) inverse zigzag scanning;
4) inverse discrete cosine transformation (IDCT); and
5) image reconstruction based on the reconstructed 8×8 pixel blocks.
The existing solutions for random-access-point decoding basically follow the approach of inserting, during the compression encoding process, restart markers or other separators between MCUs in bitstreams. However, these approaches still require a thorough scan of the whole compression data of the JPEG file to find out positions of the MCUs in bitstreams corresponding to the restart markers or separators. In particular, using the separators further necessitates differential pulse-code demodulation of each DC coefficient, thus increasing the amount of calculation payload and requiring an additional storage space for storing the DC coefficients.